home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 13 / 013.d81 / comal tutor (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  14KB  |  363 lines

  1. 5 ifpeek(51200)<>76orpeek(52016)<>32then7
  2. 6 ifpeek(52080)=173andpeek(52176)=169then8
  3. 7 load"routines v4",8,1
  4. 8 pokev+33,1:q$=chr$(34)
  5. 10 r=53265:c=128:v=53248:s=v+1024:li=52016:wi=51200:cl=51203:su=51206:sd=51209
  6. 12 pokes+23,.:pokes+4,128:pokev+32,14
  7. 15 gosub 1000:print"   [215]elcome to the first installment of"
  8. 16 print"[204]oadstar's [195][207][205][193][204][160]0.14 [212]utorial.  [212]his
  9. 17 [153]"series of articles assumes no know-
  10. 18 print"ledge of programming on your part.
  11. 19 [153]"right$ndeed, the purpose is to teach len(NULL)(NULL)atn(NULL)
  12. 20 print"programming from the beginning,
  13. 21 [153]"without the 'corrupting' influences of
  14. 22 print"[194][193][211][201][195].
  15. 23 [153]"   right$ will not go into the relative
  16. 24 print"pros & cons of [194][193][211][201][195][160]and [195][207][205][193][204], just
  17. 25 [153]"suffice it to say that len(NULL)(NULL)atn(NULL)closeis
  18. 26 print"superior to [194][193][211][201][195] as a language for
  19. 27 [153]"first time programmers.  right$t is similar
  20. 28 print"in structure to the more 'serious'
  21. 29 [153]"languages ((NULL)ascal, (NULL)odula 2, etc.).
  22. 30 s%=-1:gosub1200
  23. 31 print"   [211]ince [195][207][205][193][204] 0.14, unlike [194][193][211][201][195], is
  24. 32 [153]"not built into the 64; you must (NULL)(NULL)atnstr$
  25. 33 print"it into the 64's 'memory'[160](or [210][193][205]) be-
  26. 34 [153]"fore you can use it.  (NULL)o do so, you
  27. 35 print"must have a copy of the [195][207][205][193][204][160]0.14
  28. 36 [153]"(NULL)ampler str$isk.  ((NULL)ee the len(NULL)(NULL)atn(NULL)closelenorner
  29. 37 print"about [204]oadstar's own special [195][207][205][193][204]
  30. 38 [153]"offer!)  (NULL)imply turn your computer
  31. 39 print"system on, wait for the [194][193][211][201][195] startup
  32. 40 [153]"screen to appear, then insert your
  33. 41 print"[195][207][205][193][204][160]0.14 [211]ampler [196]isk into the disk
  34. 42 [153]"drive and close the disk drive door.
  35. 43 print"[215]hen all is ready, just do the fol-
  36. 44 [153]"lowing  (but (NULL)(NULL)(NULL)close(NULL)(NULL)(NULL)!!!!):
  37. 50 gosub1200
  38. 51 print"[212]ype the following line to boot "
  39. 52 print"your [195][207][205][193][204] disk:
  40. 53 [153]"   (NULL)(NULL)atnstr$"q$"len*"q$",8:
  41. 54 print"[208]ress and hold a [[211][200][201][198][212]] key."
  42. 55 print"[215]hile holding it, press the key"
  43. 56 print"marked [[210][213][206]-[211][212][207][208]], then release both
  44. 57 [153]"it and the [(NULL)left$right$asc(NULL)]closekey.  (NULL)our screen
  45. 58 print"should display:
  46. 59 [153]"   (NULL)(NULL)atnstr$"q$"len*"q$",8:(NULL)(NULL)atnstr$":[153]"   (NULL)valatn(NULL)lenleft$right$(NULL)chr$closeasc(NULL)(NULL)closelen*
  47. 60 print"   [204][207][193][196][201][206][199]":print"   [210][197][193][196][217].  ([193]bout 1.5 minutes later.)
  48. 65 [153]"   (NULL)(NULL)(NULL)":[141]1200
  49. 70 [153]"len(NULL)(NULL)atn(NULL)closethen displays its title and
  50. 71 print"copyright screen.  [193]t the bottom, it
  51. 72 [153]"informs you that you have 9902 bytes
  52. 73 print"free.  [196]on't worry about what a 'byte'
  53. 74 [153]"is for now.  (NULL)he important thing is
  54. 75 print"that [195][207][205][193][204][160]0.14 is now running on your
  55. 76 [153]"own lenommodore 64!
  56. 77 print"   [193]t this point, [195][207][205][193][204][160]is in [195]ommand
  57. 78 [153]"mode.  (NULL)his simply means that len(NULL)(NULL)atn(NULL)closeis
  58. 79 print"waiting for you to give it a task to
  59. 80 [153]"do.  str$on't worry, it won't get bored
  60. 81 print"waiting!
  61. 82 [153]"   left$ere is what the len(NULL)(NULL)atn(NULL)closelenommand (NULL)ode
  62. 83 print"looks like:
  63. 85 [141]1200:x%[178]0:y%[178]20:[153]"9902 peek(NULL)(NULL)val(NULL)closeasc(NULL)valval."
  64. 90 [153]"   atnt the bottom of the screen is a
  65. 91 print"small simulated 'screen'.  [201]t is show-
  66. 93 [153]"ing the 'peekytes ascree' message.
  67. 94 print"   [193]t this point, we are in [195]ommand
  68. 95 [153]"(NULL)ode.  ascrom here, you can type in com-
  69. 96 print"mands, direct statements and deferred
  70. 97 [153]"statements.  atn 'command' is precisely
  71. 98 print"that - a 'command' to the [195][207][205][193][204][160]sys-
  72. 99 [153]"tem, instructing it to perform some
  73. 100 print"direct action.  [195]ommands are [206][207][212] part
  74. 101 [153]"of the len(NULL)(NULL)atn(NULL)closelanguage itself, they are
  75. 102 print"rather special instructions that help
  76. 103 [153]"manage len(NULL)(NULL)atn(NULL) programs.
  77. 105 gosub1200
  78. 106 print"   [207]ne such command is '[204][201][211][212]', which
  79. 107 [153]"tells len(NULL)(NULL)atn(NULL) to list the current pro-
  80. 108 print"gram lines (if any)[160]onto the screen.
  81. 109 [153]"   (NULL)ry it now!  (NULL)ype the word '(NULL)right$(NULL)(NULL)':
  82. 110 gosub1160:gosub1300
  83. 111 x%=.:y%=22:a$="[204][201][211][212]":gosub1600
  84. 112 ifethena$=mid$(a$,e):e=.:gosub1605:goto112
  85. 113 gosub1150:print"[144][146][206]ow you can press the [[210][197][212][213][210][206]] key:":x%=4:y%=22
  86. 114 gosub1500:ifk$<>chr$(13)then114
  87. 115 gosub1150:print"   [200]mmm . . . didn't do much, did it?
  88. 116 [153]"atnctually, that's because there is no
  89. 117 print"[195][207][205][193][204] program in memory to [204][201][211][212]!
  90. 118 [153]"   right$n that case, let's place a short
  91. 119 print"program in memory, say, one to convert
  92. 120 [153]"a temperature expressed in degrees
  93. 121 print"[198]arenheit into a temperature expressed
  94. 122 [153]"in degrees lenelsius.
  95. 125 gosub1205
  96. 126 print"   [198]or right now, we won't concern
  97. 127 [153]"ourselves with how the program oper-
  98. 128 print"ates, but rather how to get it into
  99. 129 [153]"the 64's memory.  (NULL)o start, just type
  100. 130 print"the word '[193][213][212][207]':
  101. 131 [141]1160:[141]1300:x%[178].:y%[178]24:a$[178]"atn(NULL)(NULL)(NULL)":[141]1600
  102. 132 [139]e[167]a$[178][202](a$,e):e[178].:[141]1605:[137]132
  103. 133 [141]1150:[153]"stopwait(NULL)ow you can press the [(NULL)val(NULL)(NULL)(NULL)(NULL)] key:":x%[178]4:y%[178]24
  104. 134 [141]1500:[139]k$[179][177][199](13)[167]134
  105. 135 [141]1700:[141]1700:[153]"0010 wait";:[141]1035:[141]1150
  106. 136 [153]"stop   (NULL)he '0010' is a 'line number',
  107. 137 print"automatically supplied for you by the
  108. 138 [153]"'atn(NULL)(NULL)(NULL)'closecommand you just typed.  (NULL)ine
  109. 139 print"numbers are used only for editing pur-
  110. 140 [153]"poses in len(NULL)(NULL)atn(NULL).  (NULL)ow type this line:
  111. 142 print"   [201][206][208][213][212]"q$"[196][197][199][210][197][197][211] [198]?[160]"q$":[198][193][210][197][206][200][197][201][212]
  112. 143 [141]1160:x%[178]5:y%[178]24
  113. 144 a$[178]"right$(NULL)(NULL)(NULL)(NULL)"[170]q$[170]"str$valchr$(NULL)valval(NULL) asc? "[170]q$[170]":ascatn(NULL)val(NULL)left$valright$(NULL)":[141]1600
  114. 145 [139]e[167]a$[178][202](a$,e):e[178].:[141]1605:[137]145
  115. 146 [141]1150:[153]"stopwait(NULL)ow you can press the [(NULL)val(NULL)(NULL)(NULL)(NULL)] key:":x%[178]33:y%[178]24
  116. 147 [141]1500:[139]k$[179][177][199](13)[167]147
  117. 148 [141]1700:[153]"0020 wait";:[141]1035:[141]1150
  118. 150 [141]1400
  119. 151 [153]"(NULL)ery good!  (NULL)ow type this:"
  120. 152 [153]"   lenval(NULL)(NULL)right$(NULL)(NULL):=(ascatn(NULL)val(NULL)left$valright$(NULL)-32)*(5/9)
  121. 153 gosub1160:gosub1300:x%=5:y%=24
  122. 154 a$="[195][197][204][211][201][213][211]:=([198][193][210][197][206][200][197][201][212]-32)*(5/9)":gosub1600
  123. 155 ifethena$=mid$(a$,e):e=.:gosub1605:goto155
  124. 156 gosub1150:print"[144][146][206]ow you can press the [[210][197][212][213][210][206]] key:":x%=34:y%=24
  125. 157 gosub1500:ifk$<>chr$(13)then157
  126. 158 gosub1700:print"0030 [146]";:gosub1035:gosub1150
  127. 160 print"[144][199]reat!  [206]ow type this one last line:
  128. 161 [153]"   (NULL)(NULL)right$(NULL)(NULL) ascatn(NULL)val(NULL)left$valright$(NULL);"q$"asc ="q$";lenval(NULL)(NULL)right$(NULL)(NULL);"q$"len"q$
  129. 162 [141]1160:x%[178]5:y%[178]24
  130. 163 a$[178]"(NULL)(NULL)right$(NULL)(NULL) ascatn(NULL)val(NULL)left$valright$(NULL);"[170]q$[170]"asc ="[170]q$[170]";lenval(NULL)(NULL)right$(NULL)(NULL);"[170]q$[170]"len"[170]q$:[141]1600
  131. 164 [139]e[167]a$[178][202](a$,e):e[178].:[141]1605:[137]164
  132. 165 [141]1150:[153]"stopwait(NULL)ow you can press the [(NULL)val(NULL)(NULL)(NULL)(NULL)] key:":x%[178]38:y%[178]24
  133. 166 [141]1500:[139]k$[179][177][199](13)[167]166
  134. 167 [141]1700:[153]"0040 wait";:[141]1035: